﻿using System;
using System.Data;
using System.Web.UI.WebControls;


public partial class manager_taskaudit_Default : System.Web.UI.Page
{
    DBHelper db = new DBHelper();
    public string num_1 = "0";
    public string num_2 = "0";
    protected void Page_Load(object sender, EventArgs e)
    {
        ((Label)Master.FindControl("MESS")).Text = (Request.QueryString["mes"]);
        if (!IsPostBack)
        {
            bindData();
        }
    }
    private void bindData()
    {
        string zx_psid = Session[AppConfig.SESSION_USER_PSID].ToString();
        string userbh = Session[AppConfig.SESSION_USER_BH].ToString();

        string sql1 = "";
        string sql2 = "";

        sql1 += "select * from [dbo].[v_A_Task] where (Bm_Kh='" + zx_psid + "' or Ry_Kh='" + zx_psid + "')  and year='" + DateTime.Now.Year + "' and month='" + DateTime.Now.AddMonths(-1).Month + "' and state=0";

        sql2 += "select * from [dbo].[v_A_Task] where (Bm_Bkh='" + zx_psid + "' or Ry_Bkh='" + zx_psid + "')  and year='" + DateTime.Now.Year + "' and month='" + DateTime.Now.AddMonths(-1).Month + "' and state=0";



        DataTable dt = db.getList(sql1);
        rpt_Listask1.DataSource = dt;
        rpt_Listask1.DataBind();
        num_1 = dt.Rows.Count.ToString();

        DataTable dt2 = db.getList(sql2);
        rpt_Listask2.DataSource = dt2;
        rpt_Listask2.DataBind();
        num_2 = dt2.Rows.Count.ToString();

    }
}